home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / RTVBE210.ZIP / _DPMI.H next >
C/C++ Source or Header  |  1997-01-06  |  2KB  |  88 lines

  1. ;/************************************************************************
  2. ; *
  3. ; *     File        :   DPMI.H
  4. ; *
  5. ; *     Description :   Header for DPMI functions with Watcom
  6. ; *
  7. ; *     Copyright (C) 1995 Realtech
  8. ; *
  9. ; ***********************************************************************/
  10. #ifndef __DPMIHT
  11. #define __DPMIHT
  12.  
  13.  
  14. typedef struct {
  15.     unsigned char major;
  16.     unsigned char minor;
  17.     unsigned char realmode,paging;
  18.     unsigned char cpu;
  19.     unsigned char master_pic;
  20.     unsigned char slave_pic;
  21. }PM_DPMIInfo;
  22. typedef struct {
  23.     unsigned int len,sel,off,rseg,roff;
  24. }PM_Buffer;
  25.  
  26.  
  27. #ifdef __WATCOM__
  28. void PM_memsetf(unsigned long dst_s,unsigned long dst_o,ulong color,unsigned long n);
  29. #pragma aux PM_memsetf = \
  30. "push es"\
  31. "mov es,bx"\
  32. "push ecx"\
  33. "shr ecx,2"\
  34. "rep stosd"\
  35. "pop ecx"\
  36. "and ecx,3"\
  37. "rep stosb"\
  38. "pop es"\
  39. parm [ebx] [edi] [eax] [ecx];
  40. void PM_memcpyfn(unsigned long dst_s,unsigned long dst_o,void *src,unsigned long n);
  41. #pragma aux PM_memcpyfn = \
  42. "push es"\
  43. "mov es,ax"\
  44. "mov eax,ecx"\
  45. "shr ecx,2"\
  46. "rep movsd"\
  47. "mov ecx,eax"\
  48. "and ecx,3"\
  49. "rep movsb"\
  50. "pop es"\
  51. parm [eax] [edi] [esi] [ecx];
  52. void PM_memcpynf(void *dst,unsigned long src_s,unsigned long src_o,unsigned long n);
  53. #pragma aux PM_memcpynf = \
  54. "push ds"\
  55. "mov ds,ax"\
  56. "mov eax,ecx"\
  57. "shr ecx,2"\
  58. "rep movsd"\
  59. "mov ecx,eax"\
  60. "and ecx,3"\
  61. "rep movsb"\
  62. "pop ds"\
  63. parm [edi] [eax] [esi] [ecx];
  64. #else
  65.        // DJGPP Conventions
  66.        #define PM_memcpynf(dst,src_s,src_o,n) dosmemget(src_s, n, dest);
  67.        #define PM_memcpyfn(dst_s,dst_o,src,n) dosmemput(src, n, dst_s);
  68. #endif
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72.     #endif
  73.     int  PM_allocSelector(void);
  74.     int  PM_mapPhysicalToLinear(long phyAddr,long limit,ulong *newx);
  75.     ulong PM_memory_left(void);
  76.     void PM_specification(PM_DPMIInfo *Dps);
  77.     void PM_callES(uchar Inte,__dpmi_regs *regs,void *buffer,int size);
  78.     void RM_Free(void);
  79.     void RM_Initialize(void);
  80.     extern PM_DPMIInfo Dps;
  81.     extern PM_Buffer PMB;
  82.     #ifdef __cplusplus
  83. }
  84. #endif
  85. #define PHYSIC_ADRESS(x)   ((((long)x>>16)&(0x0000FFFF))<<4)+((long)x & 0x0000FFFF)
  86. #endif
  87.  
  88.